// 路由
const Router=require('@koa/router')
const shopcardRouter=new Router({
  prefix:'/shopcard'
})
//导入中间件
const {Shops,Goods}=require('../middelware/shopcardmiddle')
shopcardRouter.get(['/:id/:nums'],Shops,ctx=>{
  if(ctx.result>0){
    ctx.body={code:1,message:"添加成功"}
  }else{
    ctx.body={code:0,message:"添加失败"}
  }
})

shopcardRouter.get('/',Goods,ctx=>{
  ctx.body=ctx.good
})
module.exports=shopcardRouter